﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using KaiXin001er.WebBrowser;
using KaiXin001er.UTIL;

namespace KaiXin001er.Logic
{
    public partial class FormInputCode : Form
    {
        public FormInputCode()
        {
            InitializeComponent();
        }
        public string ResultStr = "";
        public string RandomStr = "";
        private void FormInputCode_Load(object sender, EventArgs e)
        {
            LoadImage();
        }
        private void LoadImage()
        {
            请求参数 rvalid = new 请求参数();
            string randomstr = RandomGen.随即小数加日期();
            rvalid.add("norect", "1");
            this.RandomStr = randomstr;

            WebAccessor da = WebAccessor.Instance;
            Image image =
                        da.GetImage(URLS.验证码地址, rvalid.ToString());
            this.pb_ImageCode.Image = image;
        }

        private void btn_changeImage_Click(object sender, EventArgs e)
        {
            this.LoadImage();
        }

        private void btn_OK_Click(object sender, EventArgs e)
        {
            this.ResultStr = this.txt_ImageText.Text;
            this.DialogResult = DialogResult.OK;
            this.Dispose();
        }
    }
}
